package com.microcore.service.asserts.impl;

import com.microcore.service.asserts.model.AssertModel;

/**
 * @author LeiZhenYang
 * @date 2019.01.10
 */
public class ContainsAssert implements IAssert {
    @Override
    public boolean run(Object value, AssertModel model) {
        if (value == null || model == null || model.getValue() == null) {
            return false;
        }
        if (value instanceof String) {
            return ((String) value).contains(model.getValue());
        }
        return false;
    }
}
